import request from '../utils/request';

// 获取菜谱列表数据(可以根据params有无userId来拉取相应列表)
export function getRecipes(params) {
  return request.post(`/recipe/recipe/page`, params);
}
// 获取菜谱详情数据
export function getRecipeDetail(recipeId) {
  return request.get(`/recipe/recipe/detail/${recipeId}`)
}

// 发布(新增)菜谱
export function addRecipe(data) {
  return request.post('/recipe/recipe/add', data);
}

// 编辑菜谱
export function editRecipe(data) {
  return request.put('/recipe/recipe/edit', data);
}

//删除菜谱
export const deleteRecipe = async (recipeId) => {
  return request.delete(`/recipe/recipe/delete/${recipeId}`);
}


